import React from "react";
import { Link, Routes, Route, Navigate } from "react-router-dom";

const Home = () => {
  return <div>home页面</div>;
};
const About = () => {
  return <div>about页面</div>;
};

const App = () => {
  return (
    <>
      <h2>router-v6-redirect</h2>
      <ul>
        <li>
          <Link to="/home">home</Link>
        </li>
        <li>
          <Link to="/about">about</Link>
        </li>
      </ul>

      <hr />

      <Routes>
        {/* Navigate */}
        <Route path="/" element={<Navigate to="/home"></Navigate>}></Route>
        <Route path="/home" element={<Home />}></Route>
        <Route path="/about" element={<About />}></Route>
      </Routes>
    </>
  );
};

export default App;
